---
title: "Datadog"
sidebarTitle: "Datadog Provider"
description: "Datadog provider allows you to query Datadog metrics and logs for monitoring and analytics."
---

## Inputs

- `query`: str: The query string to search within Datadog metrics and logs.
- `time_range`: dict = None: The time range for the query (e.g., `{'from': 'now-15m', 'to': 'now'}`)
- `source`: str = None: The source type (metrics, traces, logs).

Example:
```python
result = provider.query(
    query="avg:system.cpu.user{*}",
    from_time="now-1h",
    to_time="now"
)
```

## Outputs

_No information yet, feel free to contribute it using the "Edit this page" link at the bottom of the page_

### Additional Methods

| Method | Description | Required Scopes | Type |
|--------|-------------|----------------|------|
| `mute_monitor` | Mute a monitor | `monitors_write` | action |
| `unmute_monitor` | Unmute a monitor | `monitors_write` | action |
| `get_monitor_events` | Get all events related to this monitor | `events_read` | view |
| `get_trace` | Get trace by id | `apm_read` | view |
| `create_incident` | Create an incident | `incidents_write` | action |
| `resolve_incident` | Resolve an active incident | `incidents_write` | action |
| `add_incident_timeline_note` | Add a note to an incident timeline | `incidents_write` | action |

## Authentication Parameters

The `api_key` and `app_key` are required for connecting to the Datadog provider. You can obtain them as described in the "Connecting with the Provider" section.

## Connecting with the Provider

### API Key

To obtain the Datadog API key, follow these steps:

1. Log in to your Datadog account.
2. Navigate to the "Integrations" section.
3. Click on the "API" tab.
4. Generate a new API Key.

### App Key

To obtain the Datadog App Key, follow these steps:

1. Log in to your Datadog account.
2. Navigate to the "Integrations" section.
3. Click on the "API" tab.
4. Generate a new App Key or use an existing one.

## Fingerprinting

Fingerprints in Datadog are calculated based on the `groups` and `monitor_id` fields of an incoming/pulled event.

## Scopes

Certain scopes may be required to perform specific actions or queries via the Datadog Provider. Below is a summary of relevant scopes and their use cases:

- monitors_read (Monitors Read)
  Required: True
  Description: View monitors.
- monitors_write (Monitors Write)
  Required: False
  Description: Write monitors. (\*_Required for auto-webhook integration_)
- create_webhooks (Integrations Manage)
  Required: False
  Description: Create webhooks integrations. (\*_Required for auto-webhook integration_)
- metrics_read
  Required: False
  Description: View metrics.

## Notes

_No information yet, feel free to contribute it using the "Edit this page" link at the bottom of the page_

## Useful Links

- [Datadog API Documentation](https://docs.datadoghq.com/api/)
- [Datadog Query Language](https://docs.datadoghq.com/dashboards/querying/)

## Webhook Integration Modifications

The webhook integration adds Keep as a monitor within Datadog. It can be found under the "Monitors" section.
The integration automatically gains access to the following scopes within Datadog:
- `monitors_read`
- `monitors_write`
- `create_webhooks`
